package com.bw.mapper;

import com.bw.bean.Vo;
import com.bw.bean.Vo1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoMapper {
    @Select("select '运输次数' name, count(*) 'value' from transport_task where date(create_time)='2023-01-06'\n" +
            "union\n" +
            "select '运输里程' name,sum(actual_distance) 'value' from transport_task where date(create_time)='2023-01-06'\n" +
            "union\n" +
            "select '运输时长' name,sum(timestampdiff(second,actual_start_time,actual_end_time)) 'value' from transport_task where date(create_time)='2023-01-06'")
    List<Vo> getList1();

    @Select("select count(*) from order_info where date(create_time)='2023-01-07'")
    Double getList2();

    @Select("call c()")
    List<Vo1> getList3();

    @Select("select bri1.name,count(*) 'value' from express_task_delivery e\n" +
            "left join base_organ bo on bo.id = e.org_id\n" +
            "left join base_region_info bri on bri.id = bo.region_id\n" +
            "left join base_region_info bri1 on bri1.id=bri.parent_id\n" +
            "group by bri1.name")
    List<Vo> getList4();
}
